package ru.ng.sample.core.user;

import org.springframework.stereotype.Repository;

/**
 * User: ngorosh
 * Date: 22.05.11
 * Time: 14:01
 */
@Repository
public class ProfileManager
{
    private static String lang;
    private static String theme;

    public String getUserLang()
    {
        return lang;
    }

    public void saveUserLang(String lang)
    {
        if (lang == null)
            throw new NullPointerException( "ProfileManager cannot save Null language" );
        ProfileManager.lang = lang;
    }

    public String getUserTheme()
    {
        return theme;
    }

    public void saveUserTheme(String theme)
    {
        if (theme == null || theme.isEmpty())
            throw new NullPointerException( "Profile Manager cannot save Null theme" );
        ProfileManager.theme = theme;
    }
}
